/**
 * upload 1.0
 *
 * Copyright (c) 2009 www.01mvc.com
 *
 * http://www.01cms.com
 *
 * Depends:
 *	ui.core.js
 *	ui.draggable.js
 *	ui.resizable.js
 *  ui.dialog.js
 */
$.fn.upload = function(options){

    var defaults = {
        url: ""
	};
  
    var options = $.extend(defaults, options);
	
	$(this).click(function(){
						   
		if($('#uploadFrame').length == 0)
		{
			$('body').append('<iframe class="hidden" id="autoFrame" name="autoFrame" ></iframe>');
		}
	
		if($('.ui-dialog').length > 0)
		{
			$('.ui-dialog').remove();
		}
		
		$('<div class="ui-dialog-message"><span class="ui-dialog-loading">&nbsp;</span>正在处理,请稍候...</div>').dialog({
			title:'上传图片',
			resizable : false,
			width : 400
		});
		
		$.ajax({
			type : 'get',
			url : options.url,
			success : function(response) 
			{
				$(".ui-dialog-message").html(response);
			}
		});
	});
};